<?
	if($file = upload("picture")){
		$data["picture"] = $file[0];

		$image = new Image();
		$image->load($file[1]);
		$image->maxWidth(150);
		$image->save($file[1]);
	}

	$data['name'] = $_POST['name'];
	$data['position'] = $_POST['position'];
	$data['page'] = $_POST['page'];
	$data['year'] = $_SESSION['year'];

	$db->update("staff", $data, "id=".$_POST['id']);

	redirect("sar.php?id=".$page);
?>